package mvc;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class TestView {

	protected Shell shell;

	/**
	 * Launch the application.
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			TestView window = new TestView();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		createContents();
		shell.open();
		//shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 */
	protected void createContents() {
		shell = new Shell();
		shell.setSize(500, 300);
		shell.setText("SWT Application");		
		/*Button button1 = new Button(shell, SWT.PUSH);
		
		
		button1.setText("Push me");
		FormData formData1 = new FormData();
		formData1.top = new FormAttachment(50,0);
		button1.setLayoutData(formData1);
		
		Button button2 = new Button(shell, SWT.PUSH);
		button2.setText("Push me!!");
		FormData formData2 = new FormData();
		formData2.top = new FormAttachment(40,0);
		formData2.left = new FormAttachment(button1,5);
		button2.setLayoutData(formData2);
		
		FormData formData = new FormData(50,50);
		formData.top = new FormAttachment(20,0);
		button1.setLayoutData(formData);

		FormData formData3 = new FormData();
		formData3.left = new FormAttachment(button1,5);
		formData3.top = new FormAttachment(button1,0,SWT.TOP); 
		button2.setLayoutData(formData3);
		
		FormLayout layout = new FormLayout();
		shell.setLayout(layout);		
		
		FormData fd_composite = new FormData();
		fd_composite.top = new FormAttachment(button1, 0, SWT.TOP);
		fd_composite.left = new FormAttachment(button2, 49);
		Composite composite = new Composite(shell, SWT.NONE);
		composite.setLayoutData(fd_composite);*/
		NewOrderComposite composite = new  NewOrderComposite(shell,SWT.NONE);	
		//new NewOrderComposite(shell,SWT.NONE);
		new NewMenuComposite(shell,SWT.NONE);
		shell.setLayout(new FormLayout());
		
		
		
	}
}
